﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WebBanHang.DTO;
using System.Data.SqlClient;
namespace WebBanHang.DAO
{
    public class ThanhVien_DAO
    {
        public static void Them(ThanhVien tmp)
        {
            string sql = "insert into THANHVIEN (USERNAME,PASSWORD,HoTen,DiaChi,DienThoai,GioiTinh,HinhAnh,Email) values (@USERNAME,@PASSWORD,@HoTen,@DiaChi,@DienThoai,@GioiTinh,@HinhAnh,@Email)";
            SqlCommand cmd = new SqlCommand(sql);
            SqlParameter[] pr = {new SqlParameter("@USERNAME",tmp.UserName),
                                    new SqlParameter("@PASSWORD",tmp.PassWord),
                                    new SqlParameter("@HoTen",tmp.HoTen),                                    
                                    new SqlParameter("@DiaChi",tmp.DiaChi),
                                    new SqlParameter("@DienThoai",tmp.DienThoai),
                                    new SqlParameter("@GioiTinh",tmp.GioiTinh),
                                    new SqlParameter("@HinhAnh",tmp.Hinhanh),
                                    new SqlParameter("@Email",tmp.Email)};
            DataProvider.ExecuteNonQuery(cmd, pr);
        }
        public static void CapNhat(ThanhVien tmp)
        {

        }
    }
}